-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockVariationPicker: remove unused withSelect #53100
Conversation
Size Change: 0 B Total Size: 1.44 MB ℹ️ View Unchanged
|
Flaky tests detected in e035f76. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5690153300
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That unused date
prop is a nice find! Reviewed both commits separately and they both make sense 👍
Thanks 🚀
When looking at usages of the
getBlockVariations
selectors, I noticed a weird usage in mobileBlockVariationPicker
, where variations for thecolumns
block are connected asdate
prop. But this prop is not used at all, and the component uses thevariations
prop instead, passed from the parent.It was added in #23828, and is probably a leftover as the PR was incrementally reworked in its 31 commits. This PR removes that
withSelect
call.As a drive-by I'm also removing calls of
useMemo
, as it's unusual, and not very useful, to wrap normal JSX markup inuseMemo
. The hook doesn't even declare all its dependencies correctly, leading to ESLint warnings, and the component won't also correctly react to prop changes.